<script setup lang='ts'>
import { ref, watch } from 'vue';
import { showImagePreview } from 'vant';
const {url} = defineProps<{url:string}>()
const newUrl = ref()
watch(()=>url,(value)=>{
    newUrl.value = value
})

const showImag = () => {
    showImagePreview([newUrl.value]);
}
</script>

<template>
<div class="content">
    <img @click="showImag" :src="newUrl" alt="">
</div>
</template>

<style scoped>
.content{
    width: 100%;
    margin: auto;
    height: 60vh;
    background-color: white;
    /* background-color: wheat; */
}
img{
    width: 100%;
    height: 100%;
    object-fit: contain;
}
</style>